﻿@using ViewRes
@using System.Collections.Generic
@using DataLayer.Entities
@using DonutMgmtSystemFoundation.Models
@model List<UserDonutsModel>

@section Title{
    @Shared.TeamDonuts
}

@section Pagename{
    @Shared.TeamDonuts
}

<div class="ui grid">
    <div class="twelve wide column">
        <table class="ui table segment">
            <thead>
                <tr>
                    <th>@Donuts.GridUser</th>
                    <th>@Donuts.GridOp1</th>
                    <th>@Donuts.GridOp2</th>
                    <th>@Donuts.GridOp3</th>
                </tr>
            </thead>
            <tbody>
                @foreach (UserDonutsModel udm in Model)
                {
                    <tr>
                        <td>@udm.User.Name</td>
                        @for (int i = 0; i < 3; i++)
                        {
                            if (udm.Donuts.Count > i)
                            {
                            <td>@udm.Donuts[i].Name</td>
                            }
                            else
                            {
                            <td>&nbsp;</td>
                            }
                        }
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
